package com.txhy.certificatechain.utils;

import android.content.Context;
import android.widget.Toast;

/*
 * -----------------------------------------------------------------
 * Copyright (C) 2018-2030, by your company, All rights reserved.
 * -----------------------------------------------------------------
 * 文    件: ToastUtil.java
 * 作    者: 侯建军
 * 版    权: 1.0.0
 * 描    述: Toast统一管理类
 * 创建时间: 2018/9/19 17:33
 * 更新时间：2018/9/19 17:33
 * -----------------------------------------------------------------
 * 2018/9/19 17:33: 创建 ToastUtil.java (侯建军);
 * -----------------------------------------------------------------
 */
public class ToastUtil {

    private ToastUtil() {
        /* cannot be instantiated */
        throw new UnsupportedOperationException("cannot be instantiated");
    }
    public static boolean isShow = true;
    /**
     * 短时间显示Toast
     *
     * @param context
     * @param message
     */
    public static void showShort(Context context, CharSequence message) {
        if (isShow)
            Toast.makeText(context, message, Toast.LENGTH_SHORT).show();
    }
    /**
     * 长时间显示Toast
     *
     * @param context
     * @param message
     */
    public static void showLong(Context context, CharSequence message) {
        if (isShow)
            Toast.makeText(context, message, Toast.LENGTH_SHORT).show();
    }
    /**
     * 自定义显示Toast时间
     *
     * @param context
     * @param message
     * @param duration
     */
    public static void show(Context context, CharSequence message, int duration) {
        if (isShow)
            Toast.makeText(context, message, duration).show();
    }
}


